<?php/*  PHP version 5  Copyright (c) 2002-2018 ECISP.CN、EarcLink.COM  警告：这不是一个免费的软件，请在许可范围内使用，请尊重知识产权，侵权必究，举报有奖  作者：黄祥云 E-mail:6326420@qq.com  QQ:6326420 TEL:18665655030 / 13797552220*/



namespace admin_application;

class ForumDB {

	public static function lastPidForumType($lng = false, $return_key = false) {
		$db_where = "WHERE lng='$lng' ORDER BY pid DESC LIMIT 0,1";
		$db_table = ESPCMS_DB_PREFIX . 'bbs_typelist';
		$talbe_field_array = espcms_field_out($db_table, false);
		$read_info = espcms_db_read($db_table, $db_where, $talbe_field_array);
		if (!$read_info) {
			return false;
		}
		return !$return_key ? $read_info : $read_info[$return_key];
	}

	public static function get_bbs_typelist_view($btid = 0, $return_key = false) {
		if (!$btid || !espcms_ismatches($btid)) {
			return false;
		}
		$db_where = "WHERE btid=$btid";
		$db_table = ESPCMS_DB_PREFIX . 'bbs_typelist';
		$talbe_field_array = espcms_field_out($db_table, false);
		$read_info = espcms_db_read($db_table, $db_where, $talbe_field_array);
		if (!$read_info) {
			return false;
		}
		return !$return_key ? $read_info : $read_info[$return_key];
	}

}
